<template>
  <div class="positions">
    <van-cell-group>
      <van-cell
        v-for="(item, index) in positons"
        @click="toPositonDetail(item.id)"
        :key="index"
      >
        <template #title>
          <div class="mytitle">
            <span class="title">{{ item.name }}</span>
            <span style="color: red;font-size: 16px">{{ item.salary }}</span>
          </div>
        </template>
        <template #label>
          <div class="jobNeeds">
            <span>{{ item.city }}</span>
            <span>{{ item.experience }}</span>
            <span>{{ item.education }}</span>
          </div>
        </template>
      </van-cell>
    </van-cell-group>
  </div>
</template>

<script>
export default {
  props: ['positons', 'data'],
  data () {
    return {
      id: 1
    }
  },
  methods: {
    // 跳转职位详情
    toPositonDetail (id) {
      const comId = this.data.id
      this.$router.push(`/positionDetail/${id}?comId=${comId}`)
    }
  }
}
</script>

<style lang="less" scoped>
.positions {
  .mytitle {
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    .title {
      font-size: 20px;
      font-weight: 600;
    }
  }
  .jobNeeds {
    padding-bottom: 15px;
    span {
      margin-right: 6px;
      padding: 2px 5px;
      background-color: #eeeeee;
      border-radius: 2px;
    }
  }
}
</style>
